<?php

namespace App\Observers;

use App\Jobs\NoticeJon;
use App\Models\Notice;

class NoticeObserver
{

    /**
     * Handle the Notice "created" event.
     *
     * @param  \App\Models\Notice  $notice
     * @return void
     */
    public function created(Notice $notice)
    {
        //做看房通知，比如发送短信，发邮件，极光推送，站内信息

        //关联房东和租客的信息

        //执行发送短信等通知
        dispatch(new  NoticeJon());

    }

    /**
     * Handle the Notice "updated" event.
     *
     * @param  \App\Models\Notice  $notice
     * @return void
     */
    public function updated(Notice $notice)
    {
        //
    }

    /**
     * Handle the Notice "deleted" event.
     *
     * @param  \App\Models\Notice  $notice
     * @return void
     */
    public function deleted(Notice $notice)
    {
        //
    }

    /**
     * Handle the Notice "restored" event.
     *
     * @param  \App\Models\Notice  $notice
     * @return void
     */
    public function restored(Notice $notice)
    {
        //
    }

    /**
     * Handle the Notice "force deleted" event.
     *
     * @param  \App\Models\Notice  $notice
     * @return void
     */
    public function forceDeleted(Notice $notice)
    {
        //
    }
}
